#!/usr/bin/env sh
#!/bin/bash
log() {
    echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*"
}

# 安卓用app-arm64-v8a-release.apk，如需添加别的，换下面这个
# --target-platform android-arm,android-arm64,android-x64
log "Start Build"
flutter build apk --obfuscate --split-debug-info=debugInfo --target-platform android-arm64 --split-per-abi
log "End Build"

open $(dirname "$PWD")/build/app/outputs/flutter-apk/

log "Start Upload"
chmod a+x pgyer_upload.sh
./pgyer_upload.sh -k <API-Key> $(dirname "$PWD")/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
log "End Upload"